//
//  YBRequestManager.m
//  ShangHaiHuDongApp
//
//  Created by apple on 17/8/8.
//  Copyright © 2017年 刘应平. All rights reserved.
//

#import "YBRequestManager.h"
#import "ZJUserInfoModel.h"
@implementation YBRequestManager


#pragma mark  登录请求数据
+(void)request_loginRequestForCacheWithSuccessBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    NSString * globalID = @"";
    if (ZJUSERINFORMODEL.DEPT_MODEL_JOB.GLOBALID.length > 0) {
        globalID = ZJUSERINFORMODEL.DEPT_MODEL_JOB.GLOBALID;
    }
    else{
        if (ZJUSERINFORMODEL.DEPT_MODEL_BOOK.GLOBALID.length > 0) {
            globalID = ZJUSERINFORMODEL.DEPT_MODEL_BOOK.GLOBALID;
        }
    }
    [dic setValue:globalID forKey:@"GLOBAL_ID"];
    [dic setValue:ZJUSERINFORMODEL.ORG_ACCOUNT.MOBILE forKey:@"MOBILE"];
    [dic setValue:ZJUSERINFORMODEL.ORG_ACCOUNT.ISWORK forKey:@"ISWORK"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitOrgAction[getOrgData]" Parameter:dic Success:successBlock Fail:failBlock];
}

#pragma mark  已接收消息
+(void)request_acceptMessageListWithPage:(NSString *)page successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:page forKey:@"PAGE_NUM"];
    [dic setValue:@"10" forKey:@"PAGE_SIZE"];
    [dic setValue:ZJUSERINFORMODEL.ORG_ACCOUNT.ID forKey:@"ACCOUNT_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitMsgAction[getMyMsgs]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  删除历史消息
+(void)request_deleteMessageWithMessageID:(NSString *)messageID successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:messageID forKey:@"MSG_ID"];
    [dic setValue:ZJUSERINFORMODEL.ORG_ACCOUNT.ID forKey:@"ACCOUNT_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitMsgAction[delMsgByAccountId]" Parameter:dic Success:successBlock Fail:failBlock];
}

#pragma mark  撤回发布消息
+(void)request_returnMessageWithMessageID:(NSString *)messageID successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:messageID forKey:@"MSG_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitMsgAction[cancelMsgById]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  删除发布消息
+(void)request_deletePushMessageWithMessageID:(NSString *)messageID successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:messageID forKey:@"MSG_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitMsgAction[delPubHistMsg]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  撤回发布会议
+(void)request_returnMeetingWithHyId:(NSString *)hyId successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:hyId forKey:@"HY_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.HyAction[cancelHy]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  删除发布会议
+(void)request_deleteMeetingWithHyId:(NSString *)hyId successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:hyId forKey:@"HY_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.HyAction[delPulishHisHy]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  消息详情
+(void)request_messageDetailWithMessageID:(NSString *)messageID successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:messageID forKey:@"MSG_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitMsgAction[getMsgDetail]" Parameter:dic Success:successBlock Fail:failBlock];
}

#pragma mark  拆阅消息
+(void)request_readMessageWithMessageID:(NSString *)messageID successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:messageID forKey:@"MSG_ID"];
    [dic setValue:ZJUSERINFORMODEL.ORG_ACCOUNT.ID forKey:@"ACCOUNT_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitMsgAction[readMsg]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  获取自定义小组列表
+(void)request_customGroupListWithSuccessBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:ZJUSERINFORMODEL.ORG_ACCOUNT.ID forKey:@"ACCOUNT_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitOrgAction[getMySelfOrgs]" Parameter:dic Success:successBlock Fail:failBlock];
}



#pragma mark  创建或修改自定义小组
+(void)request_changeOrAddCustomGroupWithGroupID:(NSString *)groupID deptName:(NSString *)deptName users:(NSArray *)users successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:ZJUSERINFORMODEL.ORG_ACCOUNT.ID forKey:@"ACCOUNT_ID"];
    [dic setValue:groupID forKey:@"GROUP_ID"];
    [dic setValue:deptName forKey:@"DEPT_NAME"];
    [dic setValue:users forKey:@"USERS"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitOrgAction[addMySelfOrg]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  根据关键字搜索人员
+(void)request_searchPeopleWithKeyWord:(NSString *)keyWord successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:keyWord forKey:@"SEARCH_KEY"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitOrgAction[searchOrgMembers]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  删除自定义分组
+(void)request_deleteCustomGroupWithDeptId:(NSString *)deptId successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:deptId forKey:@"MYSELF_DEPT_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitOrgAction[delMySelfOrg]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  已发布消息
+(void)request_releaseMessageListWithPage:(NSString *)page successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:page forKey:@"PAGE_NUM"];
    [dic setValue:@"10" forKey:@"PAGE_SIZE"];
    [dic setValue:ZJUSERINFORMODEL.ORG_ACCOUNT.ID forKey:@"ACCOUNT_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitMsgAction[getMyPublishMsgs]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  未阅读人员列表
+(void)request_unReadMsgPeopleListWithMsgId:(NSString *)msgId successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:msgId forKey:@"MSG_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitMsgAction[getMsgUnReadUsers]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  会议未报名人员列表
+(void)request_unSignInMeetingPeopleListWithHyId:(NSString *)hyId successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:hyId forKey:@"HY_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.HyEnrollAction[getNoEnrolls]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  发送短信提醒
+(void)request_sendSMSNoticeWithMsgId:(NSString *)msgId msgContent:(NSString *)msgContent sendTime:(NSString *)sendTime peoplesId:(NSString *)peoplesId successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:msgId forKey:@"MSG_ID"];
    [dic setValue:msgContent forKey:@"MSG_CONTENT"];
    [dic setValue:sendTime forKey:@"SEND_TIMES"];
    [dic setValue:peoplesId forKey:@"USERID"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitMsgAction[sendMsg]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  会议发送短信提醒
+(void)request_sendSMSNoticeMeetingWithHyId:(NSString *)hyId msgContent:(NSString *)msgContent sendTime:(NSString *)sendTime peoplesId:(NSString *)peoplesId successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:hyId forKey:@"HY_ID"];
    [dic setValue:msgContent forKey:@"MSG_CONTENT"];
    [dic setValue:sendTime forKey:@"SEND_TIMES"];
    [dic setValue:peoplesId forKey:@"USERID"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitMsgAction[sendHYMsg]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  会议回执元素
+(void)request_meetingReturnItemListWithSuccessBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [NetWorkingManager postWithUrlString:@"miit.action.ReceiptAction[getReceiptList]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  创建回执单
+(void)request_createReturnCardWithActId:(NSString *)actId attrs:(NSArray *)attrs successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:actId forKey:@"ACT_ID"];
    [dic setValue:ZJUSERINFORMODEL.ORG_ACCOUNT.ID forKey:@"ACCOUNT_ID"];
    [dic setValue:attrs forKey:@"ATTRS"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitActReceiptAction[createActReceipt]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  已发布会议
+(void)request_releaseMeetingListWithPage:(NSString *)page successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:page forKey:@"PAGE_INDEX"];
    [dic setValue:@"10" forKey:@"PAGE_SIZE"];
    [dic setValue:ZJUSERINFORMODEL.ORG_ACCOUNT.ID forKey:@"ACCOUNT_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.HyAction[getFbShList]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  会议详情
+(void)request_releaseMeetingDetailWithHyId:(NSString *)hyId successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:hyId forKey:@"HY_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.HyAction[getShMsg]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  报名人员列表
+(void)request_signInMeetingPeopleListWithHyId:(NSString *)hyId successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:hyId forKey:@"HY_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.ReceiptAction[getReceipts]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark  删除报名人员信息
+(void)request_deleteSignInMeetingPeopleListWithPeopleArray:(NSArray *)peopleArray actId:(NSString *)actId successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:actId forKey:@"ACT_ID"];
    [dic setValue:peopleArray forKey:@"DATA"];
    [NetWorkingManager postWithUrlString:@"miit.action.MiitActReceiptAction[delActReceipt]" Parameter:dic Success:successBlock Fail:failBlock];
}

#pragma mark -  更新用户信息
+(void)request_updateUserInfo_dict:(NSDictionary *)dict successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    [NetWorkingManager postWithUrlString:@"miit.action.PartymemberAction[upPartymember]" Parameter:dict Success:successBlock Fail:failBlock];
}


#pragma mark -  提醒后台可以发送通知
+(void)request_noticeCanSendPushNotificationWithSuccessBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    [NetWorkingManager postWithUrlString:@"miit.action.Login[repLogin]" Parameter:@{} Success:successBlock Fail:failBlock];
}


#pragma mark -  撤销提醒列表
+(void)request_noticeBackListWithSuccessBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:ZJUSERINFORMODEL.ORG_ACCOUNT.ID forKey:@"ACCOUNT_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.BackoutMsgAction[getBackoutMsgs]" Parameter:dic Success:successBlock Fail:failBlock];
}

#pragma mark -  读取撤销信息
+(void)request_readNoticeBackWithMsgId:(NSString *)msgId successBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:msgId forKey:@"BACKOUT_MSG_ID"];
    [NetWorkingManager postWithUrlString:@"miit.action.BackoutMsgAction[readBackoutMsg]" Parameter:dic Success:successBlock Fail:failBlock];
}


#pragma mark -  获取更新版本信息
+(void)request_upDateInfoWithSuccessBlock:(NetBlock)successBlock failBlock:(NetBlock)failBlock{
    NSMutableDictionary * dic = [NSMutableDictionary dictionary];
    [dic setValue:@"a9fdedbeabc54023be2d750c7d579a55" forKey:@"KEY"];
    [NetWorkingManager postWithUrlString:@"projectMg.action.ProjectMg[getNewApk]" Parameter:dic Success:successBlock Fail:failBlock];
}


@end
